#ifndef CPP_PHONEWINDOW_H
#define CPP_PHONEWINDOW_H

#include <Global.h>
#include <MiniGui.h>

class ViewGroup;
class Context;

//@brief Phone Window
//@author cvte
//@description
class PhoneWindow {
   public:
    virtual ~PhoneWindow();

    static PhoneWindow* getInstance();
    class OnStatusBarListener {
        public:
            virtual void onViewCreated(ViewGroup& statusBar);
            virtual void onViewUnInited(ViewGroup& statusBar);
    };
    ViewGroup* getStatusBar();
    ViewGroup* getSubStatusBar();

    void setDecorView(ViewGroup* decorView);
    ViewGroup* getDecorView();
    //@method 设置主状态栏
    void setStatusBarListener(OnStatusBarListener& listener);
    //@method 设置副状态栏
    void setSubStatusBarListener(OnStatusBarListener& listener);
    void initStatusBar();
    void unInitStatusBar();

   private:
    PhoneWindow();
    ViewGroup* mStatusBar = nullptr; //主状态栏
    ViewGroup* mSubStatusBar = nullptr; //副状态栏
    ViewGroup* mDecorview = nullptr;
    OnStatusBarListener* mOnStatusBarListener = nullptr;
    OnStatusBarListener* mOnSubStatusBarListener = nullptr;

    static PhoneWindow* sInstance;
};

#endif /* CPP_PHONEWINDOW_H */